package com.java.action;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

import com.java.pojo.ComDept;
import com.java.service.IDeptService;

public class CheckAction {
private InputStream inputstream2;
private IDeptService deptservice;
private Integer dept1num;

	public String execute(){
		System.out.println("checkaction executing........dept1num:"+dept1num);
		return "success";
	}
	public InputStream getInputstream2()throws IOException {
		System.out.println("getInputStream2 ..........id:"+dept1num);
		String result="true";
		try{
		ComDept cd=deptservice.getDeptById(dept1num);
		System.out.println("checkaction executing ............dept1num"+dept1num);
		if(cd!=null){
			result="false";
		}
		}catch (Exception e) {
			e.printStackTrace();
			result="true";
		}
		inputstream2=new ByteArrayInputStream(result.getBytes());
		return inputstream2;
	}
	public void setInputstream(InputStream inputstream2) {
		this.inputstream2 = inputstream2;
	}
	public IDeptService getDeptservice() {
		return deptservice;
	}
	public void setDeptservice(IDeptService deptservice) {
		this.deptservice = deptservice;
	}
	public void setInputstream2(InputStream inputstream2) {
		this.inputstream2 = inputstream2;
	}
	public Integer getDept1num() {
		return dept1num;
	}
	public void setDept1num(Integer dept1num) {
		this.dept1num = dept1num;
	}

	



	
}
